#{extends 'orgLead.html' /}
#{ifErrors} ${error} #{/ifErrors}
<title>Users Restrictions</title>
<table>
  <tr>
    <td><b>Topic</b></td>
    <td><b>User</b></td>
    <td><b>Reason</b></td>
  </tr>
   <tr>
   <form action = "@{Application.blockUserFromTopic()}" >
   <input type = "hidden" name = "topicId" value = "${topic.id}">
    <td><b><input type = "text" disabled="disabled" value = "${topic.title}"></b></td>
    <td><select name = "userId">
<option value = "0">User</option>
#{if allIdeaDevelopers}
#{list items: allIdeaDevelopers, as:'ideaDeveloper'}
<option value = "${ideaDeveloper.user.id}">${ideaDeveloper.user.nickName}</option>
#{/list}
</select>
#{/if}
</td>
    <td><input type = "text" name = "reason" ></td>
  </tr>
  <tr>
    <td><input type = "submit" value = "Block User"></td>
</form>
  </tr>
  <tr>#{if allBlocked}
		<form action="@{Application.unblockUserFromTopic()}">
			<input type="hidden" name="topicId" value="${topic.id}">
			<td><b><input type="text" disabled="disabled"
					value="${topic.title}">
			</b>
			</td>
			<td><select name="userId">
					<option value="0">User</option>  #{list
					items: blockedList, as:'blocked'}
					<option value="${blocked.user.id}">${blocked.user.nickName}</option>
					#{/list}
			</select> </td>
			<td><input type="text" name="reason">
			</td>
	</tr>
	<tr>
		<td><input type="submit" value="Unblock User">
		</td>#{/if}
		</form>
	</tr>
</table>
    <span style="color: #c00" class="error"> #{error 'reason' /}</span><br>
    <a href = "@{Application.viewTopicById(topic.id)}">Back to ${topic.title}</a>



